﻿<inter:PluginConfigForm x:Class="Convertor.Plugin.FindAllFiles.ConfigForm"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:sm="clr-namespace:Wpf.CommonTools.SystemExtension;assembly=Wpf.CommonTools"
             xmlns:inter="clr-namespace:Convertor.Interface;assembly=Convertor.Interface"
             xmlns:conv="clr-namespace:Wpf.CommonTools.Converter;assembly=Wpf.CommonTools"
             xmlns:local="clr-namespace:Convertor.Plugin.FindAllFiles"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d"
             MinWidth="400"
             Loaded="UserControl_Loaded_1">
    <inter:PluginConfigForm.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Convertor;component\Assets\Style.xaml"/>
                <ResourceDictionary Source="Assets\Lang\StringResource.zh.xaml"/>
                <ResourceDictionary Source="Assets\Lang\StringResource.en.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <local:IsCheckedConvertor x:Key="IsCheckedConvert"/>
            <conv:FindUILanguageConverter x:Key="FindUILanguageConverter"/>
            <ObjectDataProvider x:Key="FindTypes" 
                        MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="local:FindTypes"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
        </ResourceDictionary>
    </inter:PluginConfigForm.Resources>
    <DockPanel DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type inter:PluginConfigForm}}, Path=Config}">
        <AdornerDecorator DockPanel.Dock="Top">
            <ListBox Name="lsbFindTypes" ItemsSource="{Binding Source={StaticResource FindTypes}}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <CheckBox Content="{Binding Path=., Converter={StaticResource FindUILanguageConverter}, ConverterParameter='Plugin_FindAllFile_'}" Tag="{Binding Path=.}" Checked="CheckBox_Checked_1" Unchecked="CheckBox_Unchecked_1">
                            <CheckBox.IsChecked>
                                <MultiBinding Converter="{StaticResource IsCheckedConvert}" Mode="OneWay">
                                    <Binding Path="Config" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type inter:PluginConfigForm}}"/>
                                    <Binding Path="."/>
                                </MultiBinding>
                            </CheckBox.IsChecked>
                        </CheckBox>
                    </DataTemplate>
                </ListBox.ItemTemplate>
                <sm:WatermarkService.Titlemark>
                    <TextBlock Text="{DynamicResource Plugin_FindAllFile_FindType}" TextAlignment="Right" VerticalAlignment="Bottom"></TextBlock>
                </sm:WatermarkService.Titlemark>
            </ListBox>
        </AdornerDecorator>
        <TextBlock Style="{StaticResource InfoStyle}" DockPanel.Dock="Top" Text="{Binding Path=ToolTip}"/>
    </DockPanel>
</inter:PluginConfigForm>
